<%-- 
    Document   : view2d
    Created on : 5 déc. 2012, 14:15:31
    Author     : isen
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <title>View 2D</title>
        <script type="text/javascript" src="${pageContext.request.contextPath}/resources/d3.js"></script>        
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"></script>
        <link rel="stylesheet" type="text/css" href="resources/style.css" />
        <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/smoothness/jquery-ui.css" />
        <script language="JavaScript">
            var dateDay="01";
            var dateMonth="01";
            var dateYear="2013";
            function fill(){
                var dataLocation=[];
                var requete = new XMLHttpRequest();
                var fileListReqUrl = "http://localhost:8080/WebServiceTemperatureFinal/app/Json/location";
                requete.open("GET",fileListReqUrl,true); 
                requete.onreadystatechange = function(){
                    if (requete.readyState == 4) 
                    { 
                        var echantillon = eval('(' + requete.responseText + ')'); 
                        fillListView(echantillon);
                    }
          
                };   // la fonction de pri
                requete.send(null);

            }
            function fillListView(echantillon)
            {
                var d=document.formulaire.Location;
                var size= echantillon.length;
                for (i = 0; i < size; i++) 
                { 
        
                    d.length++;
                    d.options[d.length-1].text = echantillon[i];
                }
                var i;
            }
        </script>
   <form name="formulaire" id="formulaire">
            <select name="Location" id="Location" >
                <option selected>-- Sélectionnez une Ville --</option>
            </select>
            <input type="text" id="datepicker">
            <SELECT name="Choix" id="Choix">
                <option value="day">day</option>
                <option value="month">month</option>
                <option value="years">years</option>
            </SELECT>
            <script type="text/javascript" src="${pageContext.request.contextPath}/resources/fonction2d.js"></script>
            <INPUT TYPE="BUTTON" NAME="Valider" VALUE="Valider" onclick='callDraw(document.formulaire.Choix.value,dateDay,dateMonth,dateYear,document.formulaire.Location.value)'
                   >


        </form>

    </head>
    
        

    <body>
       
    
    <script language="JavaScript">
        fill();
        jQuery(document).ready(function($){
            $( "#datepicker" ).datepicker({
                changeMonth: true,
                changeYear: true,
                onSelect: function(){
                    dateDay = $("#datepicker").datepicker('getDate').getDate();
                    dateMonth = $("#datepicker").datepicker('getDate').getMonth() + 1;
                    dateYear = $("#datepicker").datepicker('getDate').getFullYear();
            
                    if(dateDay <10)
                    {
                        dateDay="0"+dateDay;
                    }
                    if(dateMonth<10)
                    {
                        dateMonth="0"+dateMonth;
                    }
            
                }})
        });
        $.datepicker.regional['fr'] = {
            closeText: 'Fermer',
            prevText: 'Précédent',
            nextText: 'Suivant',
            currentText: 'Aujourd\'hui',
            monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
            monthNamesShort: ['Janv.','Févr.','Mars','Avril','Mai','Juin','Juil.','Août','Sept.','Oct.','Nov.','Déc.'],
            dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
            dayNamesShort: ['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'],
            dayNamesMin: ['D','L','M','M','J','V','S'],
            weekHeader: 'Sem.',
            dateFormat: 'dd/mm/yy',
            firstDay: 1,
            isRTL: false,
            showMonthAfterYear: false,
            yearSuffix: ''
        };
        $.datepicker.setDefaults($.datepicker.regional['fr']);
    </script>

</body>  


</html>
